- content_for(:title, 'My Applications')
- content_for(:body_id, 'manage_flow')

= render '/shared/breadcrumbs', breadcrumbs: [ 'Manage',
                                                link_to('Dashboard', dashboard_index_path),
                                                yield(:title)]
%section.applications
  - @apps.each do |app|
    %div.application
      .name
        = link_to app.name, app_path(app.id)
      .info
        = link_to app.name, app.imagelayers_url, target: '_blank', title: 'View this application on imagelayers.io', class: 'imagelayers-link'
        %span
          %b
            = app.services.length
          = app.service_count_label

      .actions
        = render 'application_button_menu', app: app

  .select-target-container
    .select-target{ data: { toggle: { class: 'expanded' } } }
      %header
        Create a New Application
      .target-options
        %ul
          %li
            = link_to 'From a Template or Image', new_search_path, data: { passthru: true }
          %li
            = link_to 'From a Docker Compose YAML', '#', class: 'compose-import'

  #app-from-compose-modal
    #tabs
      %ul
        %li
          %a{ href: '#import-upload' } Import from File
        %li
          %a{ href: '#import-uri' } Import from URI
      %p
        If you have an existing YAML you'd like to run as a Panamax application, you can upload a docker-compose.yml
        or import one from a URI
      #import-upload
        %h4
          Select your local docker-compose.yml
        = form_tag({ action: :create }, multipart: true, id: 'upload-form') do
          = label_tag 'app_compose_yaml_file', 'Browse local files', class: 'button-secondary'
          %span.import-file-name
          = file_field_tag 'app[compose_yaml_file]', accept: ".yaml,.yml,text/yaml,text/x-yaml,application/yaml,application/x-yaml"
      #import-uri
        %h4
          Enter the URI to your docker-compose.yml
        = form_tag({ action: :create }, id: 'uri-form') do
          = label_tag 'app_compose_yaml_uri', 'URI:'
          = text_field_tag 'app[compose_yaml_uri]'

